#include <iostream>
#include <algorithm>
#include <cstring>

using namespace std;

void reverse(char *str) {
    int lenght = strlen(str);
    
    
    for (int i=0;i<lenght/2;i++){
        swap( str[ i ], str[ lenght-i-1 ] );
    }
}

int main() {
    char str[] = "lorem ipsum";
    cout << str << endl;
    reverse(str);
    cout << str << endl;
    return 0;
}
